import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import Element from 'element-plus'

import { registerMicroApps, start } from 'qiankun';

import 'element-plus/dist/index.css' // 必须的样式文件
import 'element-plus/theme-chalk/dark/css-vars.css' // 可选暗黑主题

registerMicroApps([
  {
    name: 'user-center',
    entry: '//localhost:7100',
    container: '#container',
    activeRule: '/user',
    props: {
      token: 'xxx',
      userInfo: { id: 1, username: 'test' },
      onGlobalEvent: (event) => {
        console.log('接收子应用事件', event);
      }
    }
  },
  {
    name: 'seed-app',
    entry: '//localhost:7001',
    container: '#container',
    activeRule: '/seed',
    props: {
      token: 'xxx',
      userInfo: { id: 1, username: 'test' },
      onGlobalEvent: (event) => {
        console.log('接收子应用事件', event);
      }
    }
  },
  // {
  //   name: 'user-center',
  //   entry: '//localhost:7102',
  //   container: '#subapp-viewport',
  //   activeRule: '/user',
  //   props: {
  //     token: 'xxx',
  //     userInfo: { id: 1, username: 'test' },
  //     onGlobalEvent: (event) => {
  //       console.log('接收子应用事件', event);
  //     }
  //   }
  // },

]);
createApp(App).use(router).use(Element).mount("#app");
start();

